package mest.dao.LGF.WarehousePurchase;

import mest.VO.LGF.WarehousePurchase.warehousesave_manytomanyVO;
import mest.VO.LGF.WarehousePurchase.warehouse_productjob_purchaseVO;
import mest.VO.LGF.WarehousePurchase.warehouse_productjob_purchase_recordVO;
import mest.VO.LGF.WarehousePurchase.warehousesave_manytomany_recordVO;
import mest.entity.warehouse_purchase;
import mest.entity.warehousesave_manytomany;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description
 * @auther Machenike
 * @create 2019-12-20 13:44
 */

public interface IWarehousePurchaseDao {

    //1.未完成基本查询-数量
    int countNOFinish(@Param("theirDb") String theirDb);

    //2.未完成基本查询-分页
    List<warehouse_purchase> selectAllNOFinish(@Param("theirDb") String theirDb,@Param("index") int index, @Param("pageSize") int pageSize);

    //3.已完成基本查询-数量
    int countFinish(@Param("theirDb") String theirDb);

    //4.已完成基本查询-分页
    List<warehouse_purchase> selectAllFinish(@Param("theirDb") String theirDb,@Param("index") int index,@Param("pageSize") int pageSize);

    //查看采购情况--分页
    List<warehouse_productjob_purchaseVO>  selectPurchaseCondition(@Param("theirDb") String theirDb,@Param("wpId") int wpId, @Param("index") int index, @Param("pageSize") int pageSize);
    //查看采购情况--数量
    int selectPurchaseConditionCount(@Param("theirDb")String theirDb,@Param("wpId")int wpId);

    //2级弹出层提交，添加入库记录
    int addReocrd(warehouse_productjob_purchase_recordVO wppr) throws Exception;
    //2级弹出层提交，增加仓库流采购内容的hasBeenNumber
    int updatehasBeenNumber(warehouse_productjob_purchase_recordVO wppr) throws Exception;
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象
    warehousesave_manytomany findWSMTMbysfIdAndWfId(@Param("theirDb")String theirDb,@Param("wfId")int wfId,@Param("sfId")int sfId);
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象，无中生有
    int addWSMTM( warehousesave_manytomanyVO wsmtmVO);
    //2级弹出层提交,根据sfId,wfId查询所对应的warehousesave_manytomany对象，插入记录
    int addWSMTMRecord( warehousesave_manytomany_recordVO wsmtmVO);
    //最后修改warehousesave_manytomany种的number数量
    int updateWSMTMNumber(warehousesave_manytomany_recordVO wsmtmVO);


    //查询2级弹出层，仓库流采购单采购内容下的往期记录  -- 分页
    List<warehouse_productjob_purchase_recordVO> selectWarehousePurchasePastRecord(@Param("theirDb") String theirDb,@Param("wppId") int wppId,@Param("index") int index,@Param("pageSize") int pageSize);
    //查询2级弹出层，仓库流采购单采购内容下的往期记录  -- 数量
    int selectWarehousePurchasePastRecordCount(@Param("theirDb") String theirDb,@Param("wppId") int wppId);


    //完单操作
    int updateByWPId(@Param("theirDb") String theirDb,@Param("wpId") int ppmId,@Param("finishStatus")int status) throws Exception;
}
